import React from 'react';
import dynamic from 'dva/dynamic';
import { Route } from 'dva/router';
import { isToken } from '../utils/judgmentEquipment.js'

export default function shopOpenGroupRoute(app) {
    const ShopOpenGroup = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "loginModel" */'../models/shopOpenGroup/shopOpenGroupModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "login" */'../routes/shopOpenGroup/shopOpenGroup'),
    });
    const GroupOrder = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "loginModel" */'../models/shopOpenGroup/shopOpenGroupModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "login" */'../routes/shopOpenGroup/groupOrder'),
    });
    const GroupSearch = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "loginModel" */'../models/shopOpenGroup/shopOpenGroupModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "login" */'../routes/shopOpenGroup/groupSearch'),
    });
    const GroupDetail = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "loginModel" */'../models/shopOpenGroup/shopOpenGroupModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "login" */'../routes/shopOpenGroup/groupDetail'),
    });
    return (
        [
            <Route key="/shopOpenGroup" exact path="/shopOpenGroup" component={ShopOpenGroup}/>,
            <Route key="/groupOrder" exact path="/groupOrder" component={GroupOrder}/>,
            <Route key="/groupSearch" exact path="/groupSearch/:data" component={GroupSearch}/>,
            <Route key="/groupDetail" exact path="/groupDetail/:data" component={GroupDetail}/>,
        ]
    );
}
